home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / CENVI.DOC < prev    next >
Text File  |  1993-12-21  |  50KB  |  950 lines

  1.                     CEnvi Shareware Manual, Chapter 1:
  2.                        CEnvi Unregistered Shareware
  3.  
  4.  
  5.                      CEnvi unregistered version 1.008
  6.                              21 December 1993
  7.  
  8.                        CEnvi Shareware User's Manual
  9.  
  10.           Copyright 1993, Nombas, All Rights Reserved.
  11.           Published by Nombas, P.O. Box 875, Medford, MA 02155 USA
  12.           (617)391-6595
  13.  
  14.           Thank you for trying this shareware version of CEnvi from Nombas,
  15.           a member of the Association of Shareware Professionals (ASP).
  16.  
  17. 1.  CEnvi Unregistered Shareware
  18.  
  19. 1.1.  Introduction to Cmm and CEnvi
  20.  
  21.           Cmm (C minus minus) is 'C' for the rest of us.  CEnvi runs Cmm
  22.           programs in the DOS, Windows, OS/2, NT, Unix, etc...
  23.           environments.  Together, CEnvi and Cmm make the power and
  24.           flexibility of the C programming language part of every computer
  25.           user's environment, without the hardware, time, and programmer
  26.           resources needed for developing full-blown C programs.
  27.  
  28.           With CEnvi and Cmm, anyone can take control of their computer
  29.           environment.  C is not just for programming nerds anymore.  CEnvi
  30.           utilites, macros, batch files, and scripts can quickly be
  31.           created, shared, and modified among all computer users,
  32.           professional and amateur alike.
  33.  
  34.           CEnvi can be incorporated at a pace that is comfortable to you:
  35.           you may only want to use CEnvi code set up by a more experienced
  36.           user, you may want to enhance existing batch files with a line or
  37.           two of CEnvi code, or you may write complete utilities using
  38.           CEnvi.
  39.  
  40. 1.2.  CEnvi unregistered shareware version
  41.  
  42.           This package is the unregistered shareware version of CEnvi.
  43.           Nombas provides this unregistered shareware version of CEnvi so
  44.           that you can try the program for a while before deciding whether
  45.           to buy.  If, after a few weeks of using using this product, you
  46.           think CEnvi will be useful to you and/or your organization then
  47.           use the registration form at the end of this document (or see the
  48.           file: REGISTER.DOC) to register CEnvi.
  49.  
  50. 1.2.1   Why you should register
  51.  
  52.           If you register, then you will receive:
  53.             *The latest version of CEnvi for all supported platforms
  54.               (currently DOS, OS/2, and Windows, with NT support expected
  55.               soon) without the annoying "Please Register" reminder.
  56.             *The CEnvi user's manual (almost 100 pages, including a
  57.               description of the Cmm programming language, a tutorial for
  58.               those who have never programmed, and descriptions and
  59.               examples of the nearly 150 functions included in the CEnvi
  60.               library).
  61.             *Free incremental electronic downloads for new versions of
  62.               CEnvi for all supported operating systems.
  63.             *Unlimited support from Nombas and CEnvi/Cmm users through
  64.               CompuServe (72212,1622), internet (bsn@world.std.com), the
  65.               cenvi-cmm e-mail mailing list (cenvi-cmm@world.std.com), and
  66.               the Nombas BBS (617-391-6595).
  67.             *Access to the growing list of CEnvi utilities and libraries
  68.               (some of which are included in this unregistered shareware
  69.               package, and others are contributed by Nombas and CEnvi/Cmm
  70.               users to the electronic locations described above).
  71.             *Discounts for additional registered version of CEnvi to use
  72.               within your organization.
  73.  
  74. 1.2.2   How to register
  75.  
  76.           See the REGISTER.DOC document that is included with this package
  77.           (and is also duplicated at the end of this document), to purchase
  78.           a registered version of CEnvi.
  79.  
  80. 1.3.  Installing CEnvi, documents, and sample files
  81.  
  82.           To install this package for evaluation
  83.             * Create a directory and then copy all of these files into that
  84.               directory.
  85.             * From within that directory execute CEnvi.exe.
  86.             * At the CEnvi "Code:" prompt enter "Install.cmm" to execute
  87.               the Install program (which is written in Cmm).
  88.             * You may then test CEnvi by trying out the included example
  89.               files and by creating CEnvi code of your own.
  90.  
  91.           For DOS and OS/2 versions, the install.cmm program will set up
  92.           the PATH environment variable to include the directory you
  93.           installed the files in, and will also set the CMMPATH environment
  94.           variable to this directory.  For Windows, install will add the
  95.           CMMPATH profile value in WIN.INI (in the [CEnvi] section), and
  96.           will also add the CMM file extension to the [Extensions] section
  97.           in WIN.INI.
  98.  
  99. 1.3.1   4DOS and 4OS2 users - .cmm executable extension
  100.  
  101.           4DOS and 4OS2 users can directly execute .cmm files by
  102.           associating the .cmm file extension with your CEnvi executable.
  103.           Assuming the CEnvi.exe is in the c:\CENVID directory, then a 4DOS
  104.           user would want to add this line to AUTOEXEC.BAT:
  105.               SET .cmm=C:\CENVID\CEnvi.exe
  106.  
  107. 1.4.  Removing CEnvi unregistered shareware
  108.  
  109.           If, after testing CEnvi for a few weeks, you choose not to
  110.           register this version of CEnvi, then you should remove the
  111.           program from your computer.  (Also please consider telling Nombas
  112.           why CEnvi did not suit your needs; we need such feedback if we
  113.           are to improve the product.)
  114.  
  115.           For all operating systems, the first step for removing CEnvi is
  116.           to delete all the CEnvi files and the directory that you copied
  117.           the files to.  The next step depends on your operating system:
  118.  
  119. 1.4.1   DOS de-installation
  120.  
  121.           Install.cmm made two changes to C:\AUTOEXEC.BAT: the directory
  122.           that CEnvi was in will have been added to your PATH statement,
  123.           and the CMMPATH environment variable will have been added.  To
  124.           de-install CEnvi you must remove the CEnvi directory from the
  125.           PATH statement and you must also delete the "SET CMMPATH=..."
  126.           line.
  127.  
  128. 1.4.2   OS/2 de-installation
  129.  
  130.           Install.cmm made two changes to C:\CONFIG.SYS: the directory that
  131.           CEnvi was in will have been added to your PATH statement, and the
  132.           CMMPATH environment variable will have been added.  To de-install
  133.           CEnvi you must remove the CEnvi directory from the PATH statement
  134.           and you must also delete the "SET CMMPATH=..." line.
  135.  
  136. 1.4.3   Windows de-installation
  137.  
  138.           Install.cmm made two changes to WIN.INI: the CMM profile
  139.           extension was added and the CMMPATH profile string was created.
  140.           To de-install CEnvi you must edit WIN.INI (with NOTEPAD.EXE for
  141.           example) and remove from the [Extensions] section a line similar
  142.           to this:
  143.                CMM=C:\CENVI\CENVI.EXE ^.CMM
  144.           and also remove these line (or lines much like these) from
  145.           WIN.INI:
  146.                [CEnvi]
  147.                CMMPATH=E:\NOMBAS\CENVI\EXAMPLES.WIN
  148.  
  149. 1.5.  Using this package
  150.  
  151. 1.5.1   Unregistered CEnvi shareware executable
  152.  
  153.           The executable in this package, named CEnvi.EXE, is identical to
  154.           the registered version of CEnvi at the time this package was
  155.           created with one exception: this unregistered shareware version
  156.           will occasionally put up a screen to remind you to register your
  157.           copy of CEnvi (see the bottom of this document or REGISTER.DOC).
  158.           Nombas has spent, and will continue to spend, time and resources
  159.           developing and supporting CEnvi and Cmm.  Without your honest
  160.           support Nombas cannot improve and support CEnvi (and pay
  161.           mortgage, feed the kids, pay the doctor, etc...).
  162.  
  163.           It is likely that months have elapsed since this shareware
  164.           package has been put together (see date at the top of this file).
  165.           If so, then the version of CEnvi you receive will be an updated
  166.           version of this one.  At the time of this release, incremental
  167.           improvements have been planned in memory use, speed of execution,
  168.           debugging tools, developer tools, and documentation.
  169.  
  170. 1.5.2   Example programs
  171.  
  172.           The following example programs are included with this shareware
  173.           version of CEnvi.  Those files with a batch extension (.BAT for
  174.           DOS and .CMD for OS/2) can be run by invoking the batch file
  175.           directly.  Those files with the CEnvi source file extension
  176.           (.CMM) are invoked by executing CEnvi with the file name as the
  177.           first argument (e.g. CENVI FranTick.cmm).  Files with different
  178.           (e.g., *.LIB, *.H, *.DAT) are files used by CEnvi some of the
  179.           example programs.
  180.  
  181.           Many of the files will provide help for how to use them if they
  182.           are invoked with "/?" as the only parameter.
  183.  
  184.           All of these example files are here for you to view, study,
  185.           experiment with, and alter for your own use.  The Nombas BBS will
  186.           continue to gather CEnvi and Cmm example files created by Nombas
  187.           or uploaded by CEnvi and Cmm users; so registered users will have
  188.           a large library to choose from (maybe some other CEnvi user has
  189.           already solved your need, or perhaps their need is close to yours
  190.           and you will only have to make small modifications to someone
  191.           else's uploaded CEnvi program). 
  192.  
  193. 1.5.3   DOS example files:
  194.             *AllDirs.bat: Perform a command in this directory and all
  195.               sub-directories
  196.             *AllFiles.bat: Perform a command on all files matching a given
  197.               file specification
  198.             *Ascii.bat: Display the ascii character table
  199.             *BatLoops.bat: Examples of various methods CEnvi can use to
  200.               allow looping within batch files
  201.             *BattMem.bat: Show values stored in a PC's battery-protected
  202.               memory
  203.             *Border.cmm: Draw a simple border on the screen
  204.             *CmmEdit.cmm: VERY simple text editor; developed step-by-step
  205.               in the tutorial chapter of the Registered CEnvi Manual.
  206.             *DelTree.bat: Delete a directory tree
  207.             *DirStat.bat: Extract specific fields from a DOS "DIR" listing
  208.             *DiskFree.bat: Display free space on a disk drive
  209.             *DosTime.bat: Show time according to computer's internal clock
  210.             *ErrLev.bat: Execute a command and set the ERRLEV value as the
  211.               return code, which makes ERRORLEVEL a variable
  212.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  213.               sequence
  214.             *FileFind.bat: Wildcard search for files on current drive or on
  215.               all drives
  216.             *Find#.cmm: Extract a number from wordy output; used by
  217.               DirStat.bat
  218.             *FranTick.cmm: Animated tick who drank too much coffee
  219.             *GetUKey.cmm: Display a choice prompt and then set an
  220.               environment variable based on user's selection 
  221.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  222.               tutorial.
  223.             *HexDump.bat: Display hexadecimal dump of a file
  224.             *Install.cmm: Install this registered version of CEnvi.
  225.             *IsDay_1.bat: One method to check if it is a specific day of
  226.               the week
  227.             *IsDay_2.bat: Another method to check if it's a specific day of
  228.               the week
  229.             *IsItFri.bat: Is it Friday?
  230.             *KbdBuf.bat: Alter the size of the keyboard buffer
  231.             *KbdRate.bat: Alter the typematic rate of the keyboard
  232.             *KeyCode.bat: Display keycode of any key pressed
  233.             *KeyState.bat: Get or set the state of the NumLock, CapsLock,
  234.               or Insert keys
  235.             *KeyStuff.bat: Stuff characters into the keyboard buffer
  236.             *MemBlock.bat: Trace through DOS's allocated memory blocks
  237.             *Mouse.bat: Demonstrate reading a mouse's position and state
  238.             *MultiDir.bat: DOS's "DIR" command allowing multiple file
  239.               specifications
  240.             *NumLock.bat: Set the NumLock key on
  241.             *OneADay.bat: Perform any command(s) no more than once per day
  242.             *PathAdd.bat: Add a directory to your PATH environment
  243.               variable.
  244.             *PathDel.bat: Remove a directory from your PATH environment
  245.               variable
  246.             *PathStak.bat: Multi-level save or restore of current drive and
  247.               directory so that you can change drives and directories and
  248.               still return to this one
  249.             *PathSubs.bat: Use DOS's SUBST command to shorten your PATH
  250.               environment variable so that more paths can be fit with DOS'
  251.               127-byte limit
  252.             *Primes.bat: Demonstrate automatic array allocation for
  253.               calculating prime numbers
  254.             *PrmptDay.bat: Change command-line-prompt to display today's
  255.               date
  256.             *Quote.bat: Choose a "profound" quote at random
  257.             *REBOOT_1.BAT: One method to reboot your computer
  258.             *REBOOT_2.BAT: Another method to reboot your computer
  259.             *Restrict.cmm: Allow a limited subset of DOS commands
  260.             *RunTime.bat: Rudimentary scheme for executing a command at a
  261.               certain time of day.
  262.             *SortLen.bat: Sort any file based on line length
  263.             *Sound.bat: Play a frequency for a given time period
  264.             *Tee.cmm: Save screen output to a file while it is being
  265.               displayed on the screen
  266.             *ValidDir.bat: Verify if a directory is valid
  267.             *Wait.bat: Pause and do not return for specified number of
  268.               seconds
  269.             *WinShell.bat: Start windows with a specific shell.  Run
  270.               Windows for a single program.
  271.  
  272. 1.5.4   OS/2 example files:
  273.  
  274.           For many of these functions, you must ensure that CEnvi2PM.exe is
  275.           accessible (in the current directory or in a directory in the
  276.           search PATH).  CEnvi2PM.exe is a small program used transparently
  277.           by CEnvi.exe when the PMxxxxx() calls are used to PM-specific
  278.           functions.
  279.             *AllDirs.cmd: Perform a command in this directory and all
  280.               sub-directories
  281.             *AllFiles.cmd: Perform a command on all files matching a given
  282.               file specification
  283.             *Ascii.cmd: Display the ascii character table
  284.             *BatLoops.cmd: Examples of various methods CEnvi can use to
  285.               allow looping within batch files
  286.             *BckGrnd.cmd: Specify a new file as your desktop background
  287.               image
  288.             *BigFont.cmd: Chooses the largest font for a Windowed OS/2
  289.               session.  Uses KeyPush.lib.
  290.             *Border.cmm: Draw a simple border on the screen
  291.             *Bouncy.cmd: Start a bouncy OS/2 Command Window. This
  292.               demonstrates moving windows, embedding multiple Cmm
  293.               executables within one file, passing keystrokes, clipboard
  294.               use, and silliness.
  295.             *BoxFont.cmd: Show and alter default font for DOS and OS/2
  296.               command-line windows
  297.             *BoxPos.cmd: Show and alter default position for DOS and OS/2
  298.               command-line windows
  299.             *BugHunt.cmd: Example for using the ClipBrd.lib routines.
  300.               Constantly scan clipboard for "bug" in clipboard text
  301.             *CBPrint.cmd: Send contents of the clipboard to the printer
  302.             *CEnviSet.cmd: This file can be used instead of CEnvi.exe if
  303.               you are using environment variables as Cmm variables and need
  304.               them to be changed in the current OS/2 environment.
  305.             *ClipBrd.lib: Library of routines for reading from or writing
  306.               to the Windows clipboard
  307.             *CmmEdit.cmm: VERY simple text editor; developed step-by-step
  308.               in the tutorial chapter of the Registered CEnvi Manual.
  309.             *Comm.lib: Serial communications routines
  310.             *DelTree.cmd: Delete a directory tree
  311.             *Devices.cmd: Show status of system devices.
  312.             *DevIOCtl.lib: Function library for OS/2's DosDevIOCTL
  313.               functions
  314.             *DirStat.cmd: Extract specific fields from an OS/2 "DIR"
  315.               listing
  316.             *DiskFree.cmd: Display free space on a disk drive
  317.             *DoFiles.cmd: Perform any command on a list of files selected
  318.               from a file dialog box
  319.             *DosCalls.lib: Example library of "wrapper" function calls to
  320.               OS/2 API calls in the DosCalls library.  This file is
  321.               "#include"ed in many of the other example files.
  322.             *DosObj.cmd: Demonstrate how to initialize any session type,
  323.               program, settings, and window positions.  In this case a DOS
  324.               Window, but this is easily changed.
  325.             *DumpIni.cmd: Display profile settings from a .INI file; uses
  326.               Profile.lib
  327.             *EditCmd.cmd: Use PM's file dialog (via FileDlg.lib) to select
  328.               a *.cmd file to edit.
  329.             *EPM.cmd: Wrapper for EPM.EXE for C programmers which will
  330.               bring in related *.c, *.H and *.asm files
  331.             *ErrLev.cmd: Execute a command and set the ERRLEV value as the
  332.               return code, which makes ERRORLEVEL a variable
  333.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  334.               sequence
  335.             *FileDlg.lib: A simple interface to the WinFileDlg() PM
  336.               function.  This library file is #include'd in some of the
  337.               other CEnvi sample files.
  338.             *FileFind.cmd: Wildcard search for files on current drive or on
  339.               all drives
  340.             *FileIO.lib: Function to interface directly with OS/2's File IO
  341.             *Find#.cmm: Extract a number from wordy output; used by
  342.               DirStat.bat
  343.             *FranTick.cmm: Animated tick who drank too much coffee
  344.             *GetUKey.cmd: Display a choice prompt and then set an
  345.               environment variable based on user's selection 
  346.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  347.               tutorial.
  348.             *HexDump.cmd: Display hexadecimal dump of a file
  349.             *IDLE.cmd: Change process priority to run a CEnvi program only
  350.               during system idle time.
  351.             *IdleProg.cmd: Execute a program in the background; i.e., run
  352.               only during system idle time.
  353.             *Install.cmm: Install this registered version of CEnvi.
  354.             *IsDay_1.cmd: One method to check if it is a specific day of
  355.               the week
  356.             *IsDay_2.cmd: Another method to check if it's a specific day of
  357.               the week
  358.             *IsItFri.cmd: Is it Friday?
  359.             *KbdRate.cmd: Alter the typematic rate of the keyboard
  360.             *KeyCode.cmd: Display keycode of any key pressed
  361.             *KeyGhost.cmd: Sample for using KeyPush.lib to determine if
  362.               CEnvi is worth the price of registration.
  363.             *KeyPush.cmd: Send keystroke commands directly to a window by
  364.               window title; a quick interface into KeyPush.lib
  365.             *KeyPush.lib: Library of routines for sending keystrokes to PM
  366.               or Windowed applications.
  367.             *KeyState.cmd: Get or set the state of the NumLock, CapsLock,
  368.               or Insert keys for current session or for the whole WPS
  369.             *Kill.cmd: Terminate a running process by Process ID, Window
  370.               title, full name, or partial name
  371.             *MsgBox.lib: A wrapper library for the PM WinMessageBox()
  372.               function.  This file is #include'd in other CEnvi sample
  373.               files.
  374.             *MsgBoxes.cmd: Show various message box types using the
  375.               function in MsgBox.lib.
  376.             *MultiDir.cmd: OS/2's "DIR" command allowing multiple file
  377.               specifications
  378.             *NekoSavr.cmd: This basic screen saver program runs NEKO.EXE,
  379.               OS/2's cat & mouse game, when the mouse keys and keyboard
  380.               have been idle.
  381.             *NumLock.cmd: Turn on NUMLOCK key once, or maintain NUMLOCK ON.
  382.               A shadow of NumLock.cmd can be put in startup folder to
  383.               default computer to NumLock ON. "NumLock 1000" will check
  384.               every second to make sure that NUMLOCK is still set.
  385.             *OneADay.cmd: Perform any command(s) no more than once per day
  386.             *OS2Time.cmd: Show time according to computer's internal clock
  387.             *Parents.cmd: Show hierarchical list of ancestor's process ID's
  388.               and names
  389.             *PathAdd.cmd: Add a directory to your PATH environment
  390.               variable.
  391.             *PathDel.cmd: Remove a directory from your PATH environment
  392.               variable
  393.             *PathStak.cmd: Multi-level save or restore of current drive and
  394.               directory so that you can change drives and directories and
  395.               still return to this one
  396.             *PMdll.lib: Example library of "wrapper" routines to function
  397.               in the PM DLL (Presentatiom Manager Dynamic Link Library).
  398.               This file is "#include"ed in many of the other example files.
  399.             *Primes.cmd: Demonstrate automatic array allocation for
  400.               calculating prime numbers
  401.             *PrmptDay.cmd: Change command-line-prompt to display today's
  402.               date
  403.             *ProcList.cmd: Show list of all running processes; their names
  404.               and ID's
  405.             *Profile.lib: Function library for accessing Profiles; i.e.
  406.               .INI files
  407.             *Quote.cmd: Choose a text-mode "profound" quote at random
  408.             *QuotePM.cmd: Choose a PM-mode "profound" quote at random
  409.             *RndBckgr.cmd: Randomly select desktop background, at specified
  410.               interval, from a list of graphic file specifications
  411.             *RunTime.cmd: Rudimentary scheme for executing a command at a
  412.               certain time of day.
  413.             *Setup.cmd: Open the OS/2 Setup folder on the desktop
  414.             *ShutDown.cmd: Automated shutdown of OS/2 system
  415.             *SortLen.cmd: Sort any file based on line length
  416.             *Sound.cmd: Play a frequency for a given time period
  417.             *Switch.cmd: Switch foreground application to another process
  418.               base on process ID, full name, or partial name
  419.             *Terminal.cmd: A VERY basic terminal program; demonstrates
  420.               COMM.LIB
  421.             *Threads.cmd: Display list of all threads in all running
  422.               processes
  423.             *ValidDir.cmd: Verify if a directory is valid
  424.             *Wait.cmd: Pause and do not return for specified number of
  425.               seconds
  426.             *Windows.cmd: Start up full-screen windows session with
  427.               specified Windows program.  This file contains specific DOS
  428.               notebook settings that should be altered to meet your
  429.               computer's configuration.
  430.             *WinList.cmd: Display list of all PM windows
  431.             *WinSet.cmd: Set the position, size, state, etc... of a PM
  432.               Window
  433.             *WinTools.cmd: Demonstrate many of the capabilities of
  434.               WinTools.lib
  435.             *WinTools.lib: Library of routines for manipulating PM windows
  436.               by name or by handle
  437.             *WPFolder.cmd: Open a desktop folder for any specified
  438.               directory and optionally switch to that window
  439.  
  440. 1.5.5   Windows example files:
  441.  
  442.           The following CEnvi source programs can be run by associating the
  443.           .cmm file extension with CEnvi.exe.  This can be done by using
  444.           the File Manager: select one of these .cmm files then choose
  445.           File/Association and select the full path to CEnvi.exe.  After
  446.           this, you can run any of these exmple files simply by
  447.           double-clicking on it.
  448.             *Ascii.cmm: Display the ascii character table
  449.             *BattMem.cmm: Show values stored in a PC's battery-protected
  450.               memory
  451.             *BootEd1.cmm: Start NotePad to edit c:\AutoExec.bat and
  452.               C:\Config.sys using Windows DLL's.
  453.             *BootEd2.cmm: Start NotePad to edit c:\AutoExec.bat and
  454.               C:\Config.sys using CEnvi's spawn() function.
  455.             *Border.cmm: Draw a simple border on the screen
  456.             *BugHunt.cmm: Example for using the ClipBrd.lib routines.
  457.               Constantly scan clipboard for "bug" in clipboard text
  458.             *ClipBrd.lib: Library of routines for reading from or writing
  459.               to the Windows clipboard
  460.             *CmmEdit.cmm: VERY simple text editor; developed step-by-step
  461.               in the tutorial chapter of the Registered CEnvi Manual.
  462.             *Comm.lib: Simplified function interface into Windows' serial
  463.               communication routines
  464.             *DosTime.cmm: Show time according to computer's internal clock
  465.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  466.               sequence
  467.             *FranTick.cmm: Animated tick who drank too much coffee
  468.             *GDI.cmm: Demonstrate some of Windows' graphics functions from
  469.               GDI.lib
  470.             *GDI.lib: Library of a few of Windows' graphics routines
  471.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  472.               tutorial.
  473.             *HexDump.cmm: Display hexadecimal dump of a file
  474.             *Icons.cmm: Minimize all windows.  Demonstrate PostMessage()
  475.               from Message.lib.
  476.             *IdleTime.cmm: "ScreenSaver" - Show clock if computer is idle
  477.             *Install.cmm: Install this registered version of CEnvi.
  478.             *KeyCode.cmm: Display keycodes returned by getch().
  479.             *KeyGhost.cmm: Demonstrate how to use KeyPush.lib to control
  480.               other applications.
  481.             *KeyPush.lib: Library of routines created for passing
  482.               keystrokes to a window with the current focus.
  483.             *Message.lib: Wrapper for Windows' PostMessage() and
  484.               SendMessage() function to send commands to windows.
  485.             *MsgBox.lib: A wrapper library for Windows' MessageBox()
  486.               function.  This file is #include'd in other CEnvi sample
  487.               files.
  488.             *MsgBoxes.cmm: Show various message box types using the
  489.               function in MsgBox.lib.
  490.             *NumLock.cmm: Set the NUMLOCK key ON
  491.             *OpenCmm.cmm: Use Windows' common dialog (via PickFile.lib) to
  492.               select a *.cmm file to edit.
  493.             *PickFile.lib: A simple interface to the GetOpenFileName()
  494.               function in the Windows Common Dialog DLL.  This library file
  495.               is #include'd in some of the other CEnvi sample files.
  496.             *PMCorner.cmm: Minimize Program Manager and then move its icon
  497.               to the lower-right corner of the screen.
  498.             *PongTime.cmm: Bounce the Windows clock mini-app around
  499.             *Quote.cmm: Choose a "profound" quote at random
  500.             *RunTime.cmm: Schedule a command to execute at a specified hour
  501.               and minute.
  502.             *Terminal.cmm: A simple terminal program; demonstrate some of
  503.               the functions in COMM.lib
  504.             *WhoRYou.cmm: Design and implement a dialog box using CEnvi's
  505.               MakeWindow() and DoWindows() functions
  506.             *WinBeep.cmm: Call Windows' MessageBeep() function.
  507.             *Window.lib: A few functions and many defined values useful for
  508.               CEnvi's MakeWindow(), BreakWindow(), and DoWindows()
  509.               functions
  510.             *WinExec.lib: A wrapper library for Windows' WinExec()
  511.               function.  This file is #include'd in other CEnvi sample
  512.               files.
  513.             *WinExecs.cmm: Demonstration of Windows' WinExec() function
  514.               using the wrapper from WinExec.lib.
  515.             *WinList.cmm: Show a list of all Windows, their handles, and
  516.               their children.
  517.             *WinMsg.cmm: Demonstrate how to make a window, and show all the
  518.               messages that go to that window
  519.             *WinShell.bat: Start windows with a specific shell.  Run
  520.               Windows for a single program.  This use CENVI.EXE for DOS.
  521.             *WinTools.cmm: Demonstrate many of the capabilities of
  522.               WinTools.lib
  523.             *WinTools.lib: Library of routines for directly manipulating
  524.               windows by name or by handle
  525.             *WinUtil.lib: A small selection of utilities that may be
  526.               #include'd in CEnvi code to get simple access to Windows DLL
  527.               functions.
  528.  
  529. 1.6.  CEnvi - A Cmm Interpreter
  530.  
  531.           This section describes the CEnvi program, and describes the
  532.           various methods for use CEnvi.exe to execute Cmm programs.
  533.  
  534. 1.6.1   What is CEnvi?
  535.  
  536.           CEnvi is the first (and so far only) application to implement the
  537.           Cmm programming language.  CEnvi is a Command-line version of a
  538.           Cmm interpreter, and it can use Environment variables as if they
  539.           were global Cmm variables.  CEnvi contains a reasonable facsimile
  540.           of the standard C library, and can link at runtime to external
  541.           Cmm libraries.
  542.  
  543.           The "Envi" and the "C" in CEnvi reflects the envy that computer
  544.           professionals often feel when they are working on a computer that
  545.           does not have a complete C programming environment.  "Envi" also
  546.           refers to the environment variables that CEnvi attempts to work
  547.           with as if they were regular Cmm variables.
  548.  
  549.           Like all implementations for Cmm, CEnvi is portable between
  550.           operating systems.  It is currently testing under DOS, OS/2, and
  551.           Windows, and other OS ports are in the works.
  552.  
  553. 1.6.2   Environment Variables
  554.  
  555.           Variables in all UPPERCASE letters are taken from the environment
  556.           variables.  Environment variables are treated like other
  557.           variables except that they don't need quotes around them to
  558.           default to being strings if they don't match another type.
  559.  
  560.           To the source code, the only difference between a variable and an
  561.           environment variable is that environment variables are all
  562.           UPPER_CASE letters.  When the environment variable is first used
  563.           it is read from the environment block and some assumptions are
  564.           made about what kind of variable it is; this can lead to problems
  565.           when I=666 is interpreted as the number 666 when really it maybe
  566.           should have been the string "666".  Before the program exits, all
  567.           environment variables used by the code are then written to the
  568.           environment block.
  569.  
  570.           In some implementations (CEnvi for DOS, for example) the
  571.           environment variables remain changed even after the Cmm
  572.           interpreter exits.  In other cases, special kludges must be added
  573.           to alter a parent process' environment variables (see ESet() for
  574.           OS/2).
  575.  
  576. 1.6.3   Special Environment Variables
  577.  
  578.           These environment variables affect where CEnvi looks for source
  579.           files:
  580.             *CMMPATH: This environment will be checked for directories to
  581.               search for include files if the include file is not in the
  582.               current directory.  For Windows, this value may come from the
  583.               CMMPATH profile value in WIN.INI (in the [CEnvi] section).
  584.             *PATH: Batch-file source files (see below) will be searched in
  585.               these directories if not found in the current directory.
  586.             *CENVI_ESET: In those environment for which CEnvi cannot
  587.               covertly alter the environment variables of the command
  588.               interpreter (e.g., OS/2), this environment variable specifies
  589.               a file name.  CEnvi will write the strings necessary for the
  590.               command interpreter to set environment variables as altered
  591.               by your Cmm code.  See the description of ESet() for more
  592.               information about this command.
  593.  
  594. 1.6.4   Executing Code as command-line Input Parameters
  595.  
  596.           If a Cmm program is very short, then it can be executed wholly
  597.           from the command line.  For example, here is the famous hello
  598.           world program executed from the cli prompt:
  599.               CEnvi main() { printf("Hello world!"); }
  600.           which can be written more conisely under Cmm rules as:
  601.               CEnvi printf("Hello world!")
  602.  
  603.           You may have to keep in mind bahavior of the cli when inputting
  604.           code.  It is sometimes necessary to put quotes around code to
  605.           keep symbols from being interpreted by the cli, as in this
  606.           example:
  607.               CEnvi "for(i=0;i<10;i++) printf("%d\n",i)"
  608.           where the quotes are necessary to prevent the cli from
  609.           interpreting the "<" as file redirection.
  610.  
  611.           Also, in batch files (DOS, OS/2) you need to remember that "%"
  612.           has special meaning for the batch file processor, and so the
  613.           above line in a batch would have to be written as:
  614.               CEnvi "for(i=0;i<10;i++) printf("%%d\n",i)"
  615.  
  616. 1.6.5   Executing *.CMM Source File Code
  617.  
  618.           A file with the extension ".CMM", if the file name is given as
  619.           the first parameter to CEnvi.exe, is considered by CEnvi to be
  620.           pure CMM source code.  This file with the .CMM extension is
  621.           expected to be a plain Cmm source file, just as a C compiler
  622.           expects a file with the .C extension to be C source code.  CEnvi
  623.           will check the current directory for the .CMM file, and then
  624.           check directories in the PATH environment variable.  Any
  625.           arguments passed to CEnvi.exe after the .CMM source name are
  626.           given to the main(argc,argv) function in the source, if there is
  627.           one.  So the hellow.cmm program can look identical to the
  628.           hellow.c program, and when you run CEnvi.exe hellow.cmm you get
  629.           the same output.  If you run
  630.               CEnvi.exe FOO.CMM One Two Three
  631.           the main function in FOO.CMM would get argc=4 and
  632.           argv[0]="FOO.CMM" and argv[3]="THREE".
  633.  
  634.           This all means that if you were to have an executable FOO.EXE
  635.           that is similar to FOO.CMM, then "FOO.EXE" is interchangeable
  636.           with "CENVI FOO.CMM", i.e.,
  637.               FOO.EXE arg1 arg2 arg3
  638.           is the same as:
  639.               CENVI FOO.CMM arg1 arg2 arg3
  640.  
  641.           In OS/2 or windows or other environments where file extensions
  642.           can be associated with programs, you may want to associate the
  643.           .CMM extension with CEnvi.exe, so that double-clicking on
  644.           HELLOW.CMM will act identically to double-clicking on the
  645.           compiled-and-linked HELLOW.EXE.
  646.  
  647. 1.6.6   Batch-File Kludge
  648.  
  649.           The most convenient method for executing Cmm source code from the
  650.           DOS or OS/2 command line is sort of a kludge: if the first
  651.           argument to CEnvi is the name of a batch file, then CEnvi reads
  652.           that batch file and accepts as source all the code between the
  653.           lines "GOTO CENVI_EXIT" and ":CENVI_EXIT", and passes the command
  654.           line arguments to main(argc,argv).  This is very similar to
  655.           executing:
  656.               CEnvi.exe #include'foo,bat,,GOTO CENVI_EXIT,:CENVI_EXIT'
  657.           except that the '#include' statement is handled automatically by
  658.           CEnvi, and the rest of the command-line arguments are passed to
  659.           main().
  660.  
  661.           Note that ".bat" is the DOS version of the batch file name
  662.           extension.  This name is different for different operating
  663.           systems.
  664.  
  665.           In this way, a batch file can be run exactly like a .EXE file,
  666.           and the command arguments are passed to main in the same way.  If
  667.           the full path of the batch file is not supplied, then CENvi will
  668.           look in the current directory and then in directories in the
  669.           PATH.
  670.  
  671.           Here is an example of an OS/2 batch file that expects any number
  672.           (up to 9) of integers and sets the SUM environment variable to
  673.           the values added together.  (It calls CEnviSet instead of CEnvi
  674.           directly in order to set the environment variable.)
  675.  
  676.               @echo off
  677.               REM *********************************************************
  678.               REM *** SUM.BAT - Use CEnvi to sum lots of numbers together,*
  679.               REM ***           setting the SUM environment variable to   *
  680.               REM ***           the result of adding all the numbers.     *
  681.               REM *********************************************************
  682.               call CEnviSet %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  683.               GOTO CENVI_EXIT
  684.  
  685.               main(argc,argv)
  686.               {
  687.                 SUM = 0;
  688.                 for ( i = 1; i < argc; i++ )
  689.                 SUM += atoi(argv[i])
  690.               }
  691.  
  692.               :CENVI_EXIT
  693.  
  694. 1.6.7   EXTPROC: *.CMD Source file (For OS/2)
  695.  
  696.           Under the OS/2 command processor, you can define an external
  697.           processor to process a batch (*.cmd) file if the first statement
  698.           is EXTPROC.  EXTPROC is followed by the name of the processor,
  699.           which in this case will be "CEnvi".  This is an example file,
  700.           ARGS.CMD, of a program to display all input parameters:
  701.  
  702.               EXTPROC CEnvi
  703.  
  704.               main(argc,argv)
  705.               {
  706.                 for ( i = 0; i < argc; i++ )
  707.                 printf("Input argument %d = \%s\n",i,argv[i]);
  708.               }
  709.  
  710. 1.6.8   REXX-File Kludge (For OS/2)
  711.  
  712.           Similar to the Batch-File Kludge described above, if the first
  713.           argument to CEnvi is the name of a REXX source file then CEnvi
  714.           automatically executes the code between "SIGNAL CENVI_EXIT" and
  715.           "CENVI_EXIT:".  This example Rexx file for OS/2 behaves the same
  716.           as the previous batch program example (CEnviSet.cmd is an OS/2
  717.           batch file that helps run Cmm files if environment variables need
  718.           to be altered--see ESet in the OS2Lib appendix):
  719.  
  720.               /***********************************************************
  721.                *** SUM.CMD - Use CEnvi to sum lots of numbers together,***
  722.                ***           setting the SUM environment variable to   ***
  723.                ***           the result of adding all the numbers.     ***
  724.                ***********************************************************/
  725.               'call CEnviSet %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9'
  726.               SIGNAL CENVI_EXIT
  727.  
  728.               main(argc,argv)
  729.               {
  730.                 SUM = 0;
  731.                 for ( i = 1; i < argc; i++ )
  732.                 SUM += atoi(argv[i])
  733.               }
  734.  
  735.               CENVI_EXIT:
  736.  
  737. 1.6.9   CMM File Association and Drag-and-Drop (OS/2)
  738.  
  739.           You can associate CEnvi.exe with .cmm files through the settings
  740.           notebook of CEnvi.exe.  This lets you executed any CEnvi *.cmm
  741.           file simply by double-clicking its icon in the desktop.
  742.  
  743.           A Cmm program can be set up as a Workplace Shell program that
  744.           accepts drag and drop.  To do this, drag a program template out
  745.           of the templates folder and place it on the desktop where you
  746.           want your Cmm program to run from.  In program settings for this
  747.           program object set the program name to the path and file
  748.           specification for CEnvi.exe (e.g., "C:\CMM\CEnvi.exe").  Set
  749.           Parameters to the full source and file name of the Cmm file
  750.           (e.g., "C:\CMM\CZIP.cmm").  Then rename the program object to
  751.           whatever you want (e.g., "CZIP").  Then whenever you drag a file
  752.           onto that object then the filename will be the second argument to
  753.           main().
  754.  
  755. 1.6.10  CMM File Association and Drag-and-Drop (Windows)
  756.  
  757.           You can associate Cmm files with CEnvi.exe by using the File
  758.           Manager: select a .cmm file then choose File/Association and
  759.           select the full path to CEnvi.exe.  After this, you can run any
  760.           of *.cmm program simply by double-clicking on it.
  761.  
  762. 1.6.11  /BIND= Create Stand-Alone Cmm Executables
  763.  
  764.           The CEnvi /BIND option allows you to create stand-alone,
  765.           royalty-free executables from your Cmm code.  The result of /BIND
  766.           is a binary executable file that operates the same as if CEnvi
  767.           were invoked as an interpreter, except that CEnvi.exe is not
  768.           needed to execute the bound file, because CEnvi.exe and your Cmm
  769.           code are bound together in the created executable.
  770.  
  771.           The following example creates an executable named HELLOW.EXE that
  772.           would print "Hello world!".
  773.  
  774.               CEnvi /BIND=HELLOW printf("Hello world!");
  775.  
  776.           As another example, you could create a stand-alone editor, which
  777.           we'll call CMMEDIT.EXE, from the result of the CEnvi tutorial
  778.           with the following command:
  779.  
  780.               CEnvi /BIND=CMMEDIT.EXE CMMEDIT.CMM
  781.  
  782.           Now running "CMMEDIT.EXE C:\AUTOEXEC.BAT" from the command line
  783.           would be identical to executing "CENVI.EXE CMMEDIT.CMM
  784.           C:\AUTOEXEC.BAT".
  785.  
  786. 1.6.12  /BIND for OS/2 and CEnvi2PM.EXE
  787.  
  788.           When you /BIND Cmm source code that contains calls to
  789.           PMDynamicLink(), or other PMxxx() calls that invoke CEnvi2PM.exe,
  790.           the resulting executable will still require CEnvi2PM.exe.  So
  791.           users running the bound executable will still need CEnvi2PM.exe
  792.           in a directory of their search path.  CEnvi2PM.exe may be
  793.           distributed royalty-free.
  794.  
  795. 1.6.13  /BIND for Windows
  796.  
  797.           The simplest method for using /BIND in Windows is to execute
  798.           CEnvi.exe, and then to enter the /BIND statement and Cmm source
  799.           name from the CEnvi command prompt.  For example, to turn
  800.           WhoRYou.cmm into the stand-alone WhoRYou.exe, you would execute
  801.           CEnvi.exe and then enter the following at the CEnvi "Code:"
  802.           prompt:
  803.  
  804.               Code: /BIND=WhoRYou WhoRYou.cmm
  805.  
  806. -------------------------------- FILE LIST --------------------------------
  807. The CEnvi Unregistered Shareware package includes the files in the
  808. following list.  You are not permitted to upload or otherwise transfer
  809. copies of any registered version of CEnvi that does not include all of the
  810. files in this list.
  811.  
  812. *CENVI.EXE: CEnvi shareware executable for DOS, OS/2, or Windows.
  813. *CENVI2PM.EXE: Gateway program, executed trasnparently by CEnvi, for access
  814.   to PM-dependent system calls (OS/2 version only).
  815. *CENVI.DOC: CEnvi Shareware Manual, Chapter 1: CEnvi Unregistered Shareware
  816. *CMMTUTOR.DOC: CEnvi Shareware Manual, Chapter 2: Cmm Language Tutorial
  817. *CMM_VS_C.DOC: CEnvi Shareware Manual, Chapter 3: Cmm versus C, for C
  818.   Programmers
  819. *CENVILIB.DOC: CEnvi Shareware Manual, Chapter 4: Function Library
  820. *LICENSE.DOC: CEnvi Unregistered Shareware License Agreement
  821. *README.DOC: Introductory file. Read this first for quick intallation.
  822. *REGISTER.DOC: CEnvi registration form
  823. *INSTALL.CMM: Cmm source file for installing this shareware version
  824. * *.CMM, *.CMD, *.BAT, *.LIB: Many many sample programs using CEnvi.  See
  825.   CENVI.DOC for a complete list.
  826.  
  827. ----------------------------- REGISTRATION -------------------------------
  828. This is a shareware release.  Please register.  As a registered CEnvi user
  829. you will receive:
  830. *The latest version of CEnvi for all supported platforms (currently DOS,
  831.   OS/2, and Windows).
  832. *The CEnvi user's manual (almost 100 pages, including a description of the
  833.   Cmm programming language, a tutorial for those who have never programmed,
  834.   and descriptions and examples of the over 150 functions included in the
  835.   CEnvi library).
  836. *Free incremental electronic downloads for new versions of CEnvi for all
  837.   supported operating systems.
  838. *Unlimited support from Nombas and CEnvi/Cmm users through CompuServe
  839.   (72212,1622), internet (bsn@world.std.com), the cenvi-cmm e-mail mailing
  840.   list (cenvi-cmm@world.std.com), and the Nombas BBS
  841.   (ATDT16173916595,,,,,44444).
  842. *Access to the growing list of CEnvi utilities and libraries (some of which
  843.   are included in this unregistered shareware package, and others are
  844.   contributed by Nombas and CEnvi/Cmm users to the electronic locations
  845.   described above).
  846.  
  847. There are three ways to register CEnvi version 1.008: 
  848. ***************************************************************************
  849. ********* REGISTRATION METHOD 1: CENVI MAIL-IN REGISTRATION FORM **********
  850. ***************************************************************************
  851. Please fill out and mail in this form, along with payment.
  852.  
  853. Where did you get CEnvi? ______________________________________________
  854.  
  855. Name: _________________________________________________________________
  856.  
  857. Company: ______________________________ Position: _____________________
  858.  
  859. Address: ______________________________________________________________
  860.  
  861. _______________________________________________________________________
  862.  
  863. ______________________________________________________________________
  864.  
  865. Country: _________________________   (add ZIP code if applicable)
  866.  
  867. Phone: ___________________________  EMail: ______________________________
  868.  
  869.           Diskette size: [  ] 3.5"   [  ] 5.25"
  870.  
  871. CEnvi Registered License & Manual.... Quantity _____ x $38.00 = $ _________
  872. License fee for additional CEnvi users at
  873. your organization (does not include additional
  874. manual or diskettes)...Simultaneous-User Count _____ x $15.00 = $ _________
  875. Additional CEnvi Manuals..............Quantity _____ x $10.00 = $ _________
  876. Shipping outside USA, Canada, or Mexico  $4.00 ................ $ _________
  877.                                                        Subtotal $ _________
  878. Massachusetts residents please add 5% sales tax ............... $ _________
  879.  
  880.                                                           Total $ _________
  881.  
  882. Include a check or money order for this total, IN U.S. FUNDS AND DRAWN ON A
  883. U.S. BANK, payable to Nombas, or supply the following credit card payment
  884. information.  Credit cards orders will be processed through a distributor:
  885. Custom Computer Systems of Medford, MA.
  886.  
  887. Credit card orders (circle one): MasterCard / Visa / American Express
  888.  
  889.                                  Discover / Carte Blanche / Diners Club
  890.  
  891.     Card Number _____________________________________  Expires ____________
  892.  
  893.     Exact name on card (print) ____________________________________________
  894.  
  895.     Signature (REQUIRED) __________________________________________________
  896.  
  897. Mail this form, along with payment or credit information, to:
  898.                Nombas
  899.                P.O. Box 875
  900.                Medford, MA  02155   USA
  901.  
  902.  
  903. ***************************************************************************
  904. ******** REGISTRATION METHOD 2: COMPUSERVE ELECTRONIC REGISTRATION ********
  905. ***************************************************************************
  906. CompuServe members may register directly through the CompuServe
  907. Registration Service.  To use this service enter GO SWREG at your CI$
  908. prompt.  Registration ID is 1354 for CEnvi for DOS, 1355 for CEnvi for
  909. OS/2, and 1356 for CEnvi for Windows (you only need to register ONE
  910. version).  Nombas will immediately be informed of your registration, and
  911. the CEnvi registration fee will automatically be added to your CompuServe
  912. bill.
  913.  
  914. ***************************************************************************
  915. ************ REGISTRATION METHOD 3: Public (software) Library *************
  916. ***************************************************************************
  917. CREDIT CARD ORDERS ONLY -
  918.  
  919. You can order with MC, Visa, Amex, or Discover from Public (software)
  920. Library by calling 800-2424-PsL or 713-524-6394 or by FAX to 713-524-6398
  921. or by CIS Email to 71355,470. You can also mail credit card orders to PsL
  922. at P.O.Box 35705, Houston, TX 77235-5705.
  923.  
  924. THE ABOVE NUMBERS ARE FOR ORDERS ONLY.
  925.  
  926. Any questions about the status of the shipment of the order, refunds,
  927. registration options, product details, technical support, volume discounts,
  928. dealer pricing, site licenses, etc, must be directed to Nombas (see phone
  929. number and addresses below).
  930.  
  931. To insure that you get the latest version, PsL will notify Nombas the day
  932. of your order and we will ship the product directly to you.
  933.  
  934. CEnvi (all versions) is PsL product #11069.  Prices (including shipping and
  935. handling) are: $42 US/Canada and $45 overseas.
  936.  
  937.  
  938. ***************************************************************************
  939. Thank you for trying this shareware copy of CEnvi.  Mail inquires and other
  940. correspondences to:
  941.      Nombas
  942.      P.O. Box 875
  943.      Medford, MA  02155   USA
  944.  
  945. Nombas may also be contacted at:
  946.      Phone: (617)391-6595
  947.      Internet: bsn@world.std.com
  948.      CompuServe: 72212,1622
  949.      BBS: (617)391-6595 ext. 44 (e.g., ATDT16173916595,,,,,44444)
  950.